<!DOCTYPE html>
<html lang="en" style="background:#fff;">
<head>
    <base href="${basePath}">
    <#include "common/top.html"/>
</head>
<body style="background:#fff;overflow: hidden">
<form class="layui-form" modelAttribute="dict" name="form1" id="form1" method="post">
    <div class="layui-form-item-dept">

        <input name="dictid" name="dictid" value="${dict.dictid}" type="hidden">

        <div class="layui-form-item">
            <label class="layui-form-label">编码：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="code" id="code"
                       value="${dict.code}" maxlength="50"
                       placeholder="这里输入编码" title="编码"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">类型：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="type" id="type"
                       value="${dict.type}" maxlength="50"
                       placeholder="这里输入类型" title="类型"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><span
                    style="color: red;">*</span>编码值：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="codename" id="codename"
                       value="${dict.codename}" maxlength="50"
                       placeholder="这里输入编码值" title="编码值"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><span
                    style="color: red;">*</span>类型名称：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="typename" id="typename"
                       value="${dict.typename}" maxlength="50"
                       placeholder="这里输入类型名称" title="类型名称"/>
            </div>
        </div>
    </div>
</form>
</body>
<script type="text/javascript">

    layui.use(['form', 'table', 'laydate'], function () {
        var form = layui.form;
        var laydate = layui.laydate;

        form.render();

    });


    function submitHandler() {
        var prefix = basePath + "system/dict";

        $.operate.post(prefix + '/updateDict', $("#form1").serializeArray(), function (result) {
            if (result.status == true) {
                layer.alert(result.msg, function (index) {
                    var index1 = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(index1);
                    layer.close(index);
                });
            } else {
                parent.layer.alert(result.msg);
            }
        });
    }
</script>
</body>
</html>
